package stack_queue.stack;

public class StackTest {
    public static void main(String[] args) {
        MyStack<Integer> stack=new MyStack<>();
        stack.push(1);
        stack.push(2);
        stack.push(3);
        //打印栈所有元素
        System.out.println(stack);
        //打印栈顶元素
        System.out.println(stack.peek());
        //出栈，并打印栈顶元素
        stack.pop();
        System.out.println(stack);
    }
}
